package com.example.backend.dto;

import com.example.backend.domain.enums.Role;
import com.example.backend.domain.enums.UserStatus;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 更新用户请求DTO
 */
@Data
public class UpdateUserRequest {
    @Size(min = 3, max = 64, message = "用户名长度必须在3-64个字符之间")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "用户名只能包含字母、数字和下划线")
    private String username;

    @Size(max = 128, message = "真实姓名长度不能超过128个字符")
    private String fullName;

    @Email(message = "邮箱格式不正确")
    @Size(max = 128, message = "邮箱长度不能超过128个字符")
    private String email;

    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @Size(max = 255, message = "头像URL长度不能超过255个字符")
    private String avatarUrl;

    @Size(max = 100, message = "部门名称长度不能超过100个字符")
    private String department;

    @Size(max = 100, message = "职位名称长度不能超过100个字符")
    private String position;

    @Size(max = 50, message = "工号长度不能超过50个字符")
    private String employeeId;

    private Role role;
    private UserStatus status;
}
